export const rules = {
    deviceName: [
        { required: true, message: '请输入设备名称', trigger: 'blur' },
        { min: 2, max: 20, message: '设备名称长度2-20位', trigger: 'blur' },
    ],
    deviceCode: [
        { required: true, message: '请输入设备编码', trigger: 'blur' },
        { min: 2, max: 20, message: '设备编码长度2-20位', trigger: 'blur' },
        {pattern:new RegExp(/^[0-9a-zA-Z]{2,}$/,'g'),message:"编码只允许包含字母与数字",trigger: 'blur' }
    ],
    pdtCode: [
        { required: true, message: '请选择产品', trigger: 'change' }
    ],
    deviceLocation: [
        {
            required: true,
            message: '请选择设备位置',
            trigger: 'change',
        },
    ],
    deviceAddress: [
        { required: true, message: '请输入设备地址', trigger: 'blur' },
        { min: 2, max: 60, message: '设备地址长度2-60位', trigger: 'blur' },
    ],
}